Update tests for tweaked error messages
authorAlex Crichton <alex@alexcrichton.com>
Sat, 21 Mar 2015 03:23:53 +0000 (20:23 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Sat, 21 Mar 2015 03:23:53 +0000 (20:23 -0700)
tests/test_cargo_build_lib.rs
tests/test_cargo_compile.rs
tests/test_cargo_compile_custom_build.rs
tests/test_cargo_test.rs

index 97320184a0fb2e50a22e8a62b8cf1f95ce248083..e26f0903321a25f31cb31f28dc0e0dfb59d24ff0 100644 (file)
@@ -51,7 +51,6 @@ test!(build_with_no_lib {
         "#);
 
     assert_that(p.cargo_process("build").arg("--lib"),
-                execs()
-                .with_status(101)
-                .with_stderr("There is no lib to build, remove `--lib` flag"));
+                execs().with_status(101)
+                       .with_stderr("no library targets found"));
 });
index 1a1b41e306c047aca9c460c87091b3925f604454..70029f0a23010c5f8f2be16c8aee3135c3034c57 100644 (file)
@@ -5,7 +5,7 @@ use tempdir::TempDir;
 
 use support::{project, execs, main_file, basic_bin_manifest};
 use support::{COMPILING, RUNNING, ProjectBuilder};
-use hamcrest::{assert_that, existing_file};
+use hamcrest::{assert_that, existing_file, is_not};
 use support::paths::CargoPathExt;
 use cargo::util::process;
 
@@ -1349,9 +1349,7 @@ test!(dep_no_libs {
         "#)
         .file("bar/src/main.rs", "");
     assert_that(foo.cargo_process("build"),
-                execs().with_status(101)
-                       .with_stderr("\
-Package `bar v0.0.0 ([..])` has no library targets"));
+                execs().with_status(0));
 });
 
 test!(recompile_space_in_name {
@@ -1552,14 +1550,14 @@ test!(example_bin_same_name {
         .exec_with_output()
         .unwrap();
 
-    assert_that(&p.bin("foo"), existing_file());
+    assert_that(&p.bin("foo"), is_not(existing_file()));
     assert_that(&p.bin("examples/foo"), existing_file());
 
     p.cargo("test").arg("--no-run").arg("-v")
                    .exec_with_output()
                    .unwrap();
 
-    assert_that(&p.bin("foo"), existing_file());
+    assert_that(&p.bin("foo"), is_not(existing_file()));
     assert_that(&p.bin("examples/foo"), existing_file());
 });
 
index 20b4557ef2e694200a871276a7a3b550233f4ccf..3bea9644b6bc993c79f75f6a6807cec6f14f3846 100644 (file)
@@ -91,7 +91,7 @@ test!(custom_build_env_vars {
                 assert_eq!(opt, "0");
 
                 let opt = env::var("PROFILE").unwrap();
-                assert_eq!(opt, "compile");
+                assert_eq!(opt, "debug");
 
                 let debug = env::var("DEBUG").unwrap();
                 assert_eq!(debug, "true");
@@ -1176,7 +1176,7 @@ test!(profile_and_opt_level_set_correctly {
 
               fn main() {
                   assert_eq!(env::var("OPT_LEVEL").unwrap(), "3");
-                  assert_eq!(env::var("PROFILE").unwrap(), "bench");
+                  assert_eq!(env::var("PROFILE").unwrap(), "release");
                   assert_eq!(env::var("DEBUG").unwrap(), "false");
               }
         "#);
index d8b5fe28c75e1c305398051d123c1997bb80899e..fb8a43b5594d41bae1eb5d9f0e559bc217247dc3 100644 (file)
@@ -91,7 +91,7 @@ test!(many_similar_names {
             #[test] fn test_test() { foo::foo() }
         "#);
 
-    let output = p.cargo_process("test").exec_with_output().unwrap();
+    let output = p.cargo_process("test").arg("-v").exec_with_output().unwrap();
     let output = str::from_utf8(&output.stdout).unwrap();
     assert!(output.contains("test bin_test"), "bin_test missing\n{}", output);
     assert!(output.contains("test lib_test"), "lib_test missing\n{}", output);